
#ifndef XDNS_SERVER_STATE_LISTENER_H
#define XDNS_SERVER_STATE_LISTENER_H

#include "xdns.h"

class XdnsData;
class XdnsHeaderInfo;

class XdnsServerStateListener
{
public:
    XdnsServerStateListener();
    virtual ~XdnsServerStateListener();

    /*! Callback function for receiving the reply.

        This callback function is called when user calls the function
        SendQuery of class XdnsServerState.

        @param queryId Query ID identified which query is related with
                       the reply.
        @param error XE_Ok if success.
        @param data Pointer to raw data of the reply if there is data
                    existing, NULL otherwise. It will be released after
                    calling this function, user should not try to take
                    the ownership.
        @param startOffset The offset specifies the start position for
                           the DNS response in the parameter data.
        @param header Pointer to the decoded DNS header of the reply if
                      the DNS header has already been decoded before,
                      NULL otherwise.
        @return None.
    */
    virtual void ReplyReceived(long queryId,
                               XdnsError error,
                               const XdnsData* data,
                               size_t startOffset,
                               const XdnsHeaderInfo* header
                               ) = 0;
};

#endif  // XDNS_SERVER_STATE_LISTENER_H

